************************************************************************************************
*** tables.do (21.11.2024)
*** REPLICATION FILES OF TABLES AND FIGURES
*** Brox, Enzo; Goller, Daniel
*** Tournaments, Contestant Heterogeneity and Performance
************************************************************************************************

clear all
set more off


********************************************************************************
*****************************DEFINE DIRECTORIES*********************************

cd ""


	
********************************************************************************
********************************LOAD DATA***************************************	
	
use DCHaP, clear


********************************************************************************
******************************DEFINE MACROS*************************************

local var_f_1 "i.Round i.tourn_id i.Fav_id"
local var_u_1 "i.Round i.tourn_id i.Und_id"
local var_f_2 "Fav_rankN_lagged Und_rankN_lagged i.tourn_id i.Round i.Fav_id"
local var_u_2 "Fav_rankN_lagged Und_rankN_lagged i.tourn_id i.Round i.Und_id"
local var_f_3 "Fav_starts Fav_rankN_lagged Und_rankN_lagged Fav_years_playing Und_years_playing Fav_home Und_home i.tourn_id i.Round i.Fav_id"
local var_u_3 "Fav_starts Fav_rankN_lagged Und_rankN_lagged Fav_years_playing Und_years_playing Fav_home Und_home i.tourn_id i.Round i.Und_id"
local var_c_2 "Fav_rankN_lagged Und_rankN_lagged i.tourn_id i.Round i.Fav_id i.Und_id"
local var_c_3 "Fav_starts Fav_rankN_lagged Und_rankN_lagged Fav_years_playing Und_years_playing Fav_home Und_home i.tourn_id i.Round i.Fav_id i.Und_id"
local var_f_4 "i.tourn_id i.Round Fav_av_lagged Fav_starts Fav_rankN_lagged Und_rankN_lagged Fav_years_playing Und_years_playing Fav_home Und_home "
local var_u_4 "i.tourn_id i.Round Und_av_lagged Fav_starts Fav_rankN_lagged Und_rankN_lagged Fav_years_playing Und_years_playing Fav_home Und_home"
local var_f_5 "i.Round i.Fav_yr_id Fav_starts Und_rankN_lagged Und_years_playing Fav_home Und_home"
local var_u_5 "i.Round i.Und_yr_id Fav_starts Fav_rankN_lagged Fav_years_playing Fav_home Und_home"
local var_of_3 "OFav_starts OFav_rankN_lagged OUnd_rankN_lagged OFav_years_playing OUnd_years_playing OFav_home OUnd_home i.tourn_id i.Round i.OFav_id"
local var_ou_3 "OFav_starts OFav_rankN_lagged OUnd_rankN_lagged OFav_years_playing OUnd_years_playing OFav_home OUnd_home i.tourn_id i.Round i.OUnd_id"


********************************************************************************
********************************************************************************

********************************************************************************


***Table 1


* Step 1: Summarize the variables and store the statistics
estpost summarize Fav_win Fav_av9 Und_av9 Total_av share_max_legs Total_180 ratio_av_FU Upd_av_twin Und_starts opp_known Fav_starts Fav_rankN_lagged Und_rankN_lagged Fav_years_playing Und_years_playing Fav_home Und_home

* Step 2: to tex 
estout using "table1.tex",  style(tex) ///
    cells("mean(fmt(3)) sd(fmt(3))") /// 
			  mlabels("mean" "standard deviation") ///
			      varlabels(Fav_win "Favorite wins" Fav_av9 "Favorite 3-darts average (performance)" Und_av9 "Underdog 3-darts average (performance)" Total_av "Mean 3-darts average (performance)" share_max_legs "Contest length (proportion 	of legs needed)" Total_180 "Number of max. performance (Score = 180) in contest" ratio_av_FU "Ability ratio" Upd_av_twin "Expected ability (next opponent)" Und_starts "Underdog starts contest" opp_known "Opponent is known" Fav_starts "Favorite starts contest" Fav_rankN_lagged "Favorite world ranking" Und_rankN_lagged "Underdog world ranking" Fav_years_playing "Favorite years playing darts" Und_years_playing "Underdog years playing darts (experience)" Fav_home "Favorite performs at home event" Und_home "Underdog performs at home event") ///
    prehead("\resizebox{\columnwidth}{!}{%" "\begin{tabular}{l r r} \toprule \toprule") ///
	posthead("\midrule")  collabels(none) ///
			postfoot("\bottomrule \bottomrule" "\end{tabular}%" "}")  

			
********************************************************************************

***Table 2

* Regressions for Panel A: Underdog's performance
reg Und_av9 ratio_av_FU `var_u_1', vce(cluster Und_id)
estimates store U_av9_1
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "" , replace

reg Und_av9 ratio_av_FU `var_u_2', vce(cluster Und_id)
estimates store U_av9_2
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "" , replace

reg Und_av9 ratio_av_FU `var_u_3', vce(cluster Und_id)
estimates store U_av9_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

* Regressions for Panel B: Favorite's performance
reg Fav_av9 ratio_av_FU `var_f_1', vce(cluster Fav_id)
estimates store F_av9_1
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "" , replace

reg Fav_av9 ratio_av_FU `var_f_2', vce(cluster Fav_id)
estimates store F_av9_2
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "" , replace

reg Fav_av9 ratio_av_FU `var_f_3', vce(cluster Fav_id)
estimates store F_av9_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace


* Panel A: Underdog's Performance to LaTeX
estout U_av9_1 U_av9_2 U_av9_3 using "table2.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(ratio_* Fav_rankN_lagged Und_rankN_lagged Fav_years_playing Und_years_playing) ///
    refcat(ratio_av_FU "\noalign{\smallskip}\textit{Panel A: Underdog's Performance}", nolabel) ///
    varlabels(ratio_av_FU "Current ability ratio" Fav_rankN_lagged "Favorite world ranking" ///
              Und_rankN_lagged "Underdog world ranking" Fav_years_playing "Favorite experience" ///
              Und_years_playing "Underdog experience") ///
			  mlabels("(1)" "(2)" "(3)" ) ///
    prehead("\resizebox{\columnwidth}{!}{%" "\begin{tabular}{l r r r  } \toprule \toprule") ///
    collabels(none) replace posthead("\midrule") 

* Panel B: Favorite's Performance to LaTeX
estout F_av9_1 F_av9_2 F_av9_3 using "table2.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(ratio_* Fav_rankN_lagged Und_rankN_lagged Fav_years_playing Und_years_playing) ///
	refcat(ratio_av_FU " \midrule \noalign{\smallskip}\textit{Panel B: Favorite's Performance}", nolabel) ///
    varlabels(ratio_av_FU "Current ability ratio" Fav_rankN_lagged "Favorite world ranking" ///
              Und_rankN_lagged "Underdog world ranking" Fav_years_playing "Favorite experience" ///
              Und_years_playing "Underdog experience") ///
			  stats(a1 b1 c1 d1 N, fmt(%9.0fc) labels("\midrule \noalign{\smallskip}Stage FE" "Tournament-by-Year-FE" "Individual FE" "All Covariates" "\midrule \noalign{\smallskip}N")) ///
			postfoot("\bottomrule \bottomrule" "\end{tabular}%" "}")  ///
			collabels(none) mlabels(none) append
			
			
			
********************************************************************************			
		
***Table 3

*Panel A: Underdog's performance

reg Und_av9 ratio_av_FU `var_u_3', vce(cluster Und_id)
estimates store U_av9_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Und_h1_av9 ratio_av_FU `var_u_3',vce(cluster Und_id)
estimates store U_h1_av9_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Und_h2_av9 ratio_av_FU `var_u_3',vce(cluster Und_id)
estimates store U_h2_av9_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace


*Panel B: Favorite's performance

reg Fav_av9 ratio_av_FU `var_f_3', vce(cluster Fav_id)
estimates store F_av9_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Fav_h1_av9 ratio_av_FU `var_f_3',vce(cluster Fav_id)
estimates store F_h1_av9_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Fav_h2_av9 ratio_av_FU `var_f_3',vce(cluster Fav_id)
estimates store F_h2_av9_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace


*Panel C: Mean (combined) performance


reg Total_av ratio_av_FU `var_c_3',vce(cluster Fav_id)
estimates store T_av9_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Total_av_h1 ratio_av_FU `var_c_3',vce(cluster Fav_id)
estimates store T_h1_av9_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Total_av_h2 ratio_av_FU `var_c_3',vce(cluster Fav_id)
estimates store T_h2_av9_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace



* Panel A: Underdog's Performance to LaTeX
estout U_av9_3 U_h1_av9_3 U_h2_av9_3 using "table3.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(ratio_*) ///
    refcat(ratio_av_FU "\noalign{\smallskip}\textit{Panel A: Underdog's Performance}", nolabel) ///
    varlabels(ratio_av_FU "Current ability ratio") ///
prehead("\resizebox{\columnwidth}{!}{%" "\begin{tabular}{l r r r  } \toprule \toprule & \multicolumn{1}{c}{Performance} & \multicolumn{2}{c}{Performance in} \\" "& within contest & first half & second half \\" "\cmidrule(lr){2-4}" ) ///
mlabels("(1)" "(2)" "(3)" ) ///
    collabels(none) replace posthead("\midrule") 
	
	* Panel A: Favorite's Performance to LaTeX
estout F_av9_3 F_h1_av9_3 F_h2_av9_3 using "table3.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(ratio_*) ///
    refcat(ratio_av_FU "\noalign{\smallskip}\textit{Panel B: Favorite's Performance}", nolabel) ///
    varlabels(ratio_av_FU "Current ability ratio") ///
    collabels(none) mlabels(none)  append  


* Panel B: Average Performance to LaTeX
estout T_av9_3 T_h1_av9_3 T_h2_av9_3 using "table3.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(ratio_*) ///
	refcat(ratio_av_FU " \noalign{\smallskip}\textit{Panel C: Combined (average) Performance}", nolabel) ///
    varlabels(ratio_av_FU "Current ability ratio") ///
			  stats(a1 b1 c1 d1 N, fmt(%9.0fc) labels("\midrule \noalign{\smallskip}Stage FE" "Tournament-by-Year-FE" "Individual FE" "All Covariates" "\midrule \noalign{\smallskip}N")) ///
			postfoot("\bottomrule \bottomrule" "\end{tabular}%" "}")  ///
			collabels(none) mlabels(none) append
			
			
			
			
********************************************************************************
			
***Table 4


*Panel A: Higher-ability contestant win

reg Fav_win ratio_av_FU `var_f_2',vce(cluster Fav_id)
estimates store F_win_2
estadd local 	a1 "" , replace
estadd local 	b1 "x" , replace

reg Fav_win ratio_av_FU `var_f_3',vce(cluster Fav_id)
estimates store F_win_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace


*Panel B: Contest length

reg share_max_legs ratio_av_FU `var_f_2',vce(cluster Fav_id)
estimates store F_leg_2
estadd local 	a1 "x" , replace
estadd local 	b1 "" , replace

reg share_max_legs ratio_av_FU `var_f_3',vce(cluster Fav_id)
estimates store F_leg_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace

*Panel C: Number max. performance

reg Total_180 ratio_av_FU `var_c_2',vce(cluster Fav_id)
estimates store T_180_2
estadd local 	a1 "x" , replace
estadd local 	b1 "" , replace

reg Total_180 ratio_av_FU `var_c_3',vce(cluster Fav_id)
estimates store T_180_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace



* Panel A: Higher-ability contestant win to LaTeX
estout F_win_2 F_win_3 using "table4.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(ratio_*) ///
    refcat(ratio_av_FU "\noalign{\smallskip}\textit{Panel A: Higher-ability contestant win}", nolabel) ///
    varlabels(ratio_av_FU "Ability ratio") ///
			  mlabels("(1)" "(2)" "(3)" ) ///
    prehead("\resizebox{\columnwidth}{!}{%" "\begin{tabular}{l r r r  } \toprule \toprule") ///
    collabels(none) replace posthead("\midrule") 
	
	
		* Panel B: Contest length to LaTeX
estout F_leg_2 F_leg_3 using "table4.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(ratio_*) ///
    refcat(ratio_av_FU "\noalign{\smallskip}\textit{Panel B: Contest length}", nolabel) ///
    varlabels(ratio_av_FU "Ability ratio") ///
    collabels(none) mlabels(none)  append  


* Panel C: Number of max. performance to LaTeX
estout T_180_2 T_180_3 using "table4.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(ratio_*) ///
	refcat(ratio_av_FU " \noalign{\smallskip}\textit{Panel C: Number of max. performance}", nolabel) ///
    varlabels(ratio_av_FU "Ability ratio") ///
			  stats(a1 b1 N, fmt(%9.0fc) labels("\midrule \noalign{\smallskip}All FE" "All Covariates" "\midrule \noalign{\smallskip}N")) ///
			postfoot("\bottomrule \bottomrule" "\end{tabular}%" "}")  ///
			collabels(none) mlabels(none) append
			
			
			
			
			
********************************************************************************
			
***Table 5			
			
			
	
/*	Split Underdog head start into three (thirds) 'treatment'-variables for low/medium/high ability ratio	*/
g low_ratio=0
replace low_ratio=1 if ratio_av_FU<1.027
g med_ratio=0
replace med_ratio=1 if ratio_av_FU>=1.027&ratio_av_FU<=1.063657
g high_ratio=0
replace high_ratio=1 if ratio_av_FU>1.063657

g Und_starts__ratio_low=Und_starts*low_ratio
g Und_starts__ratio_med=Und_starts*med_ratio
g Und_starts__ratio_high=Und_starts*high_ratio




*Panel A: Baseline effect

reg Fav_win Und_starts ratio_av_FU `var_f_3', vce(cluster Fav_id)
estimates store Fw_fma_3x
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Fav_av9 Und_starts ratio_av_FU `var_f_3', vce(cluster Fav_id)
estimates store F_fma_3x
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Und_av9 Und_starts ratio_av_FU `var_u_3', vce(cluster Und_id)
estimates store U_fma_3x
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Total_av Und_starts ratio_av_FU `var_c_3', vce(cluster Fav_id)
estimates store T_fma_3x
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

*Panel B: Interaction effect

reg Fav_win ratio_av_FU Und_starts__ratio_low Und_starts__ratio_med Und_starts__ratio_high  `var_f_3', vce(cluster Fav_id)
estimates store Fw_fma_3xb
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Fav_av9 ratio_av_FU Und_starts__ratio_low Und_starts__ratio_med Und_starts__ratio_high  `var_f_3', vce(cluster Fav_id)
estimates store F_fma_3xb
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Und_av9 ratio_av_FU Und_starts__ratio_low Und_starts__ratio_med Und_starts__ratio_high  `var_u_3', vce(cluster Und_id)
estimates store U_fma_3xb
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Total_av ratio_av_FU Und_starts__ratio_low Und_starts__ratio_med Und_starts__ratio_high `var_c_3', vce(cluster Fav_id)
estimates store T_fma_3xb
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace
		
			
			
			
			
			* Panel A: Baseline to LaTeX
estout Fw_fma_3x F_fma_3x U_fma_3x T_fma_3x using "table5.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(Und_starts) ///
    refcat(Und_starts "\noalign{\smallskip}\textit{Panel A: Baseline effect}", nolabel) ///
    varlabels(Und_starts "Underdog head start") ///
prehead("\resizebox{\columnwidth}{!}{%" "\begin{tabular}{l r r r r } \toprule \toprule & \multicolumn{1}{c}{Favorite} & \multicolumn{3}{c}{Performance} \\"  " & \multicolumn{1}{c}{Win} & Favorite & Underdog & Average \\" "\cmidrule(lr){2-5}") ///
mlabels("(1)" "(2)" "(3)" "(4)") ///
    collabels(none) replace posthead("\midrule") 
	
			* Panel B: to LaTeX
estout Fw_fma_3xb F_fma_3xb U_fma_3xb T_fma_3xb using "table5.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(ratio_*) ///
    refcat(ratio_av_FU "\noalign{\smallskip}\textit{Panel B: Interaction effect}", nolabel) ///
    varlabels(ratio_av_FU "Current ability ratio") ///
    collabels(none) mlabels(none)  append  

	
* Panel B: to LaTeX
estout Fw_fma_3xb F_fma_3xb U_fma_3xb T_fma_3xb using "table5.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(Und_starts__ratio_low Und_starts__ratio_med Und_starts__ratio_high) ///
	refcat(Und_starts__ratio_low " \noalign{\smallskip}Underdog head start", nolabel) ///
    varlabels(Und_starts__ratio_low "x low ability ratio" Und_starts__ratio_med "x medium ability ratio" Und_starts__ratio_high "x high ability ratio") ///
			  stats(a1 b1 c1 d1 N, fmt(%9.0fc) labels("\midrule \noalign{\smallskip}Stage FE" "Tournament-by-Year-FE" "Individual FE" "All Covariates" "\midrule \noalign{\smallskip}N")) ///
			postfoot("\bottomrule \bottomrule" "\end{tabular}%" "}")  ///
			collabels(none) mlabels(none) append
			
			
			
********************************************************************************			
			
						
			
***Table 6. Shadow effects in multi-stage tournaments 


* Panel A: Linear Regression

reg Fav_win Upd_av_twin `var_f_3',vce(cluster Fav_id)
estimates store F_win_upd_3

reg Fav_av9 Upd_av_twin `var_f_3',vce(cluster Fav_id)
estimates store F_av9_upd_3

reg Und_av9 Upd_av_twin `var_u_3',vce(cluster Und_id)
estimates store U_av9_upd_3

reg Total_av Upd_av_twin `var_f_3' i.Und_id,vce(cluster Fav_id)
estimates store T_av9_upd_3

estimates table F_win_upd_3 F_av9_upd_3 U_av9_upd_3 T_av9_upd_3, keep(Upd_av_twin) se p b(%5.3f) style(oneline) varwidth(12) modelwidth(10)

* Panel B: Instrumental variable

ivregress 2sls Fav_win i.Round i.tourn_id (Upd_av_twin=opp_known), vce(cluster Fav_id)
estimates store F_win_upd_IV

ivregress 2sls Fav_av9 i.Round i.tourn_id (Upd_av_twin=opp_known), vce(cluster Fav_id)
estimates store F_av9_upd_IV

ivregress 2sls Und_av9 i.Round i.tourn_id (Upd_av_twin=opp_known), vce(cluster Und_id)
estimates store U_av9_upd_IV

ivregress 2sls Total_av i.Round i.tourn_id (Upd_av_twin=opp_known), vce(cluster Fav_id)
estimates store T_av9_upd_IV


* Panel A: Linear regression to LaTeX
estout F_win_upd_3 F_av9_upd_3 U_av9_upd_3 T_av9_upd_3 using "table6.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(Upd_av_twin) ///
    refcat(Upd_av_twin "\noalign{\smallskip}\textit{Panel A: Linear regression}", nolabel) ///
    varlabels(Upd_av_twin "Expected ability") ///
			  mlabels("(1)" "(2)" "(3)" "(4)") ///
prehead("\resizebox{\columnwidth}{!}{%" "\begin{tabular}{l r r r r } \toprule \toprule & \multicolumn{1}{c}{Favorite} & \multicolumn{3}{c}{Performance} \\"  " & \multicolumn{1}{c}{Win} & Favorite & Underdog & Average \\" "\cmidrule(lr){2-5}") ///
    collabels(none) replace posthead("\midrule") 

* Panel B: Instrumental variable to LaTeX
estout F_win_upd_IV F_av9_upd_IV U_av9_upd_IV T_av9_upd_IV using "table6.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(Upd_av_twin) ///
	refcat(Upd_av_twin "\noalign{\smallskip}\textit{Panel B: Instrumental variable}", nolabel) ///
    varlabels(Upd_av_twin "Expected ability") ///
			  stats(N, fmt(%9.0fc) labels("\midrule \noalign{\smallskip}N")) ///
			postfoot("\bottomrule \bottomrule" "\end{tabular}%" "}")  ///
			collabels(none) mlabels(none) append


			
********************************************************************************


***Table A.1


* Step 1: Summarize the variables and store the statistics
estpost summarize Fav_win Fav_av9 Fav_h1_av9 Fav_h2_av9 Und_av9 Und_h1_av9 Und_h2_av9 Total_av Total_av_h1 Total_av_h2 share_max_legs Total_180 ratio_av_FU log_abil_diff Oratio_odds_UF Upd_av_twin Und_starts Fav_av_lagged Und_av_lagged opp_known Fav_starts Fav_rankN_lagged Und_rankN_lagged Fav_years_playing Und_years_playing Fav_home Und_home price_money_rescal

* Step 2: to tex
estout using "tablea1.tex",  style(tex) ///
    cells("mean(fmt(3)) sd(fmt(3))") /// 
			  mlabels("mean" "standard deviation") ///
			      varlabels(Fav_win "Favorite wins" Fav_av9 "Favorite 3-darts average (performance)" Fav_h1_av9 "Favorite 3-darts average in first half" Fav_h2_av9 "Favorite 3-darts average in second half" Und_av9 "Underdog 3-darts average (performance)" Und_h1_av9 "Underdog 3-darts average in first half" Und_h2_av9 "Underdog 3-darts average in second half" Total_av "Mean 3-darts average (performance)" Total_av_h1 "Mean 3-darts average in first half" Total_av_h2 "Mean 3-darts average in second half" share_max_legs "Contest length (proportion of legs needed)" Total_180 "Number of max. performance (Score = 180) in contest" ratio_av_FU "Ability ratio (favorite to underdog)" log_abil_diff "Log ability difference (favorite minus underdog)" Oratio_odds_UF "Odds ability ratio (underdog to favorite)" Upd_av_twin "Expected ability (of opponent in next stage)" Und_starts "Underdog starts contest" Fav_av_lagged "Favorite ability" Und_av_lagged "Underdog ability" opp_known "Opponent is known" Fav_starts "Favorite starts contest "Fav_rankN_lagged "Favorite world ranking" Und_rankN_lagged "Underdog world ranking" Fav_years_playing "Favorite years playing darts (experience)" Und_years_playing "Underdog years playing darts (experience)" Fav_home "Favorite performs at home event" Und_home "Underdog performs at home event" price_money_rescal "Prize money (standardized)") ///
    prehead("\resizebox{\columnwidth}{!}{%" "\begin{tabular}{l r r} \toprule \toprule") ///
	posthead("\midrule")  collabels(none) ///
			postfoot("\bottomrule \bottomrule" "\end{tabular}%" "}")  

********************************************************************************		
			
			
			
***Table A.2	
											  												  

*Panel A: Underdog's performance
reg Und_av9 ratio_av_FU share_pm_contest `var_u_3',vce(cluster Und_id)
estimates store U_av9_3_PF_1
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Und_av9 ratio_av_FU share_pm_contest future_pm_tourn Upd_av_twin `var_u_3',vce(cluster Und_id)
estimates store U_av9_3_PF_2
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Und_av9 ratio_av_FU share_pm_contest Fav_legs_pl_tourn Und_legs_pl_tourn `var_u_3',vce(cluster Und_id)
estimates store U_av9_3_PF_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Und_av9 ratio_av_FU share_pm_contest future_pm_tourn Upd_av_twin Fav_legs_pl_tourn Und_legs_pl_tourn `var_u_3',vce(cluster Und_id)
estimates store U_av9_3_PF_4
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace



*Panel B: Favorite's performance
reg Fav_av9 ratio_av_FU share_pm_contest `var_f_3',vce(cluster Fav_id)
estimates store F_av9_3_PF_1
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Fav_av9 ratio_av_FU share_pm_contest future_pm_tourn Upd_av_twin `var_f_3',vce(cluster Fav_id)
estimates store F_av9_3_PF_2
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Fav_av9 ratio_av_FU share_pm_contest Fav_legs_pl_tourn Und_legs_pl_tourn `var_f_3',vce(cluster Fav_id)
estimates store F_av9_3_PF_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Fav_av9 ratio_av_FU share_pm_contest future_pm_tourn Upd_av_twin Fav_legs_pl_tourn Und_legs_pl_tourn `var_f_3',vce(cluster Fav_id)
estimates store F_av9_3_PF_4
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace



* Panel A: Underdog's Performance to LaTeX
estout U_av9_3_PF_1 U_av9_3_PF_2 U_av9_3_PF_3 U_av9_3_PF_4 using "tablea2.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(ratio_av_FU share_pm_contest future_pm_tourn Upd_av_twin Fav_legs_pl_tourn Und_legs_pl_tourn) ///
    refcat(ratio_av_FU "\noalign{\smallskip}\textit{Panel A: Underdog's Performance}", nolabel) ///
    varlabels(ratio_av_FU "Current ability ratio" share_pm_contest "Prize money at stake (cr)" future_pm_tourn "Prize money at stake (fr)" Upd_av_twin "Expected ability" Fav_legs_pl_tourn "Favorite legs played" Und_legs_pl_tourn "Underdog legs played") ///
			  mlabels("(1)" "(2)" "(3)" "(4)") ///
    prehead("\resizebox{\columnwidth}{!}{%" "\begin{tabular}{l r r r r} \toprule \toprule") ///
    collabels(none) replace posthead("\midrule") 

* Panel B: Favorite's Performance to LaTeX
estout F_av9_3_PF_1 F_av9_3_PF_2 F_av9_3_PF_3 F_av9_3_PF_4 using "tablea2.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(ratio_av_FU share_pm_contest future_pm_tourn Upd_av_twin Fav_legs_pl_tourn Und_legs_pl_tourn) ///
	refcat(ratio_av_FU "\midrule \noalign{\smallskip}\textit{Panel B: Favorite's performance}", nolabel) ///
    varlabels(ratio_av_FU "Current ability ratio" share_pm_contest "Prize money at stake (cr)" future_pm_tourn "Prize money at stake (fr)" Upd_av_twin "Expected ability" Fav_legs_pl_tourn "Favorite legs played" Und_legs_pl_tourn "Underdog legs played") ///
			  stats(a1 b1 c1 d1 N, fmt(%9.0fc) labels("\midrule \noalign{\smallskip}Stage FE" "Tournament-by-Year-FE" "Individual FE" "All Covariates" "\midrule \noalign{\smallskip}N")) ///
			postfoot("\bottomrule \bottomrule" "\end{tabular}%" "}")  ///
			collabels(none) mlabels(none) append

			
			
			
			
********************************************************************************
	
			
			
***Table A.3										 

ivregress 2sls Fav_win i.Round i.tourn_id (Upd_av_twin=opp_known), vce(cluster Fav_id) first
reg Upd_av_twin i.Round i.tourn_id opp_known,vce(cluster Fav_id)
estimates store iv_firststage
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace


*  First stage to LaTeX
estout iv_firststage using "tablea3.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(opp_known) ///
    varlabels(opp_known "Opponent known before") ///
			  mlabels(none) ///
    prehead("\resizebox{\columnwidth}{!}{%" "\begin{tabular}{l r } \toprule \toprule") ///
	stats(a1 b1 N, fmt(%9.0fc) labels("\midrule \noalign{\smallskip}Stage FE" "Tournament-by-Year-FE" "\midrule \noalign{\smallskip}N")) ///
    collabels(none) replace postfoot("\bottomrule \bottomrule" "\end{tabular}%" "}")  ///



	
			
********************************************************************************		
			
			
***Table A.4


*Panel A: Low ability next opponent
reg Fav_av9 ratio_av_FU `var_f_3' if Upd_av_twin<94.7,vce(cluster Fav_id)
estimates store F_av9_3_easy
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Fav_h1_av9 ratio_av_FU `var_f_3' if Upd_av_twin<94.7,vce(cluster Fav_id)
estimates store F_av9_h1_3_easy
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Fav_h2_av9 ratio_av_FU `var_f_3' if Upd_av_twin<94.7,vce(cluster Fav_id)
estimates store F_av9_h2_3_easy
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace


*Panel B: High ability next opponent
reg Fav_av9 ratio_av_FU `var_f_3' if Upd_av_twin>=94.7,vce(cluster Fav_id)
estimates store F_av9_3_hard
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Fav_h1_av9 ratio_av_FU `var_f_3' if Upd_av_twin>=94.7,vce(cluster Fav_id)
estimates store F_av9_h1_3_hard
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Fav_h2_av9 ratio_av_FU `var_f_3' if Upd_av_twin>=94.7,vce(cluster Fav_id)
estimates store F_av9_h2_3_hard
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace




* Panel A: Low-ability next opponent to LaTeX
estout F_av9_3_easy F_av9_h1_3_easy F_av9_h2_3_easy using "tablea4.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(ratio_*) ///
    refcat(ratio_av_FU "\noalign{\smallskip}\textit{Panel A: Low-ability next opponent}", nolabel) ///
    varlabels(ratio_av_FU "Ability ratio") ///
			  mlabels("(1)" "(2)" "(3)" ) ///
prehead("\resizebox{\columnwidth}{!}{%" "\begin{tabular}{l r r r  } \toprule \toprule & \multicolumn{1}{c}{Favorite Performance} & \multicolumn{2}{c}{Favorite Performance in} \\" "& \multicolumn{1}{c}{within contest} & \multicolumn{1}{c}{first half} & \multicolumn{1}{c}{second half} \\" "\cmidrule(lr){2-4}" ) ///
			  stats(a1 b1 c1 d1 N, fmt(%9.0fc) labels("\midrule \noalign{\smallskip}Stage FE" "Tournament-by-Year-FE" "Individual FE" "All Covariates" "\midrule \noalign{\smallskip}N")) ///
    collabels(none) replace posthead("\midrule")   ///
				postfoot("\midrule")


* Panel B: High-ability next opponent to LaTeX
estout F_av9_3_hard F_av9_h1_3_hard F_av9_h2_3_hard using "tablea4.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(ratio_*) ///
	refcat(ratio_av_FU " \noalign{\smallskip}\textit{Panel B: High-ability next opponent}", nolabel) ///
    varlabels(ratio_av_FU "Ability ratio") ///
			  stats(a1 b1 c1 d1 N, fmt(%9.0fc) labels("\midrule \noalign{\smallskip}Stage FE" "Tournament-by-Year-FE" "Individual FE" "All Covariates" "\midrule \noalign{\smallskip}N" )) ///
			postfoot("\bottomrule \bottomrule" "\end{tabular}%" "}")  ///
			collabels(none) mlabels(none) append

			
********************************************************************************



***Table A.5





*Panel A.1
*(1)
reg Fav_av9 log_abil_diff `var_f_3',vce(cluster Fav_id)
estimates store F_av9_Rc1
*(2)
reg OFav_av9 Oratio_odds_UF `var_of_3',vce(cluster OFav_id)
estimates store F_odds_3
*(3)
reg Fav_av9 ratio_av_FU `var_f_3' if ratio_av_FU<=1.22159,vce(cluster Fav_id)
estimates store F_av9_Rc3
*(4)
reg Fav_av9 ratio_av_FU `var_f_3' if Round>2,vce(cluster Fav_id)
estimates store F_av9_Rc4
*(5)
reg Fav_av9 ratio_av_FU `var_f_5',vce(cluster Fav_yr_id)
estimates store F_av9_Rc5
*(6)
reg Fav_av9 ratio_av_FU `var_f_4',vce(cluster Fav_id)
estimates store F_av9_Rc6
*(7)
reg Fav_av6 ratio_av_FU `var_f_3',vce(cluster Fav_id)
estimates store F_av9_Rc7
**



*Panel A.2
*(1)
reg Und_av9 log_abil_diff `var_u_3',vce(cluster Und_id)
estimates store U_av9_Rc1
*(2) 
reg OUnd_av9 Oratio_odds_UF `var_ou_3',vce(cluster OUnd_id)
estimates store U_odds_3
*(3)
reg Und_av9 ratio_av_FU `var_u_3' if ratio_av_FU<=1.22159,vce(cluster Und_id)
estimates store U_av9_Rc3
*(4)
reg Und_av9 ratio_av_FU `var_u_3' if Round>2,vce(cluster Und_id)
estimates store U_av9_Rc4
*(5)
reg Und_av9 ratio_av_FU `var_u_5',vce(cluster Und_yr_id)
estimates store U_av9_Rc5
*(6)
reg Und_av9 ratio_av_FU `var_u_4',vce(cluster Und_id)
estimates store U_av9_Rc6
*(7)
reg Und_av6 ratio_av_FU `var_u_3',vce(cluster Und_id)
estimates store U_av9_Rc7



*Panel B.1
*(1)
reg Fav_h1_av9 log_abil_diff `var_f_3',vce(cluster Fav_id)
estimates store F_av9_h1_Rc1
*(2) 
reg OFav_h1_av9 Oratio_odds_UF `var_of_3',vce(cluster OFav_id)
estimates store F_h1_odds_3
*(3)
reg Fav_h1_av9 ratio_av_FU `var_f_3' if ratio_av_FU<=1.22159,vce(cluster Fav_id)
estimates store F_av9_h1_Rc3
*(4)
reg Fav_h1_av9 ratio_av_FU `var_f_3' if Round>2,vce(cluster Fav_id)
estimates store F_av9_h1_Rc4
*(5)
reg Fav_h1_av9 ratio_av_FU `var_f_5',vce(cluster Fav_yr_id)
estimates store F_av9_h1_Rc5
*(6)
reg Fav_h1_av9 ratio_av_FU `var_f_4',vce(cluster Fav_id)
estimates store F_av9_h1_Rc6
*(7)
reg Fav_h1_av6 ratio_av_FU `var_f_3',vce(cluster Fav_id)
estimates store F_av9_h1_Rc7



*Panel B.2
*(1)
reg Und_h1_av9 log_abil_diff `var_u_3',vce(cluster Und_id)
estimates store U_av9_h1_Rc1
*(2) 
reg OUnd_h1_av9 Oratio_odds_UF `var_ou_3',vce(cluster OUnd_id)
estimates store U_h1_odds_3
*(3)
reg Und_h1_av9 ratio_av_FU `var_u_3' if ratio_av_FU<=1.22159,vce(cluster Und_id)
estimates store U_av9_h1_Rc3
*(4)
reg Und_h1_av9 ratio_av_FU `var_u_3' if Round>2,vce(cluster Und_id)
estimates store U_av9_h1_Rc4
*(5)
reg Und_h1_av9 ratio_av_FU `var_u_5',vce(cluster Und_yr_id)
estimates store U_av9_h1_Rc5
*(6)
reg Und_h1_av9 ratio_av_FU `var_u_4',vce(cluster Und_id)
estimates store U_av9_h1_Rc6
*(7)
reg Und_h1_av6 ratio_av_FU `var_u_3',vce(cluster Und_id)
estimates store U_av9_h1_Rc7



* Panel A1:  to LaTeX
estout F_av9_Rc1 F_odds_3 F_av9_Rc3 F_av9_Rc4 F_av9_Rc5 F_av9_Rc6 F_av9_Rc7 using "tablea5.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(ratio_av_FU Oratio_odds_UF log_abil_diff) ///
			    refcat(log_abil_diff "\noalign{\smallskip}\textit{A.1: Favorite's performance in contest}", nolabel) ///	
    varlabels(ratio_av_FU "Ability ratio" log_abil_diff "log difference" Oratio_odds_UF "odds ratio") ///
			  mlabels("(1)" "(2)" "(3)" "(4)" "(5)" "(6)" "(7)") ///
prehead("\resizebox{\columnwidth}{!}{%" "\begin{tabular}{l r r r r r r r} \toprule \toprule & \multicolumn{2}{c}{Treatment} & \multicolumn{2}{c}{Sample} & \multicolumn{2}{c}{Controls} & \multicolumn{1}{c}{Outcome} \\" "& \multicolumn{1}{c}{log spec.} & \multicolumn{1}{c}{odds spec.} & \multicolumn{1}{c}{w/o outliers} & \multicolumn{1}{c}{w/o (s.) finals} & \multicolumn{1}{c}{ind x yr FE} & \multicolumn{1}{c}{ability} & \multicolumn{1}{c}{6 darts av.}\\" "\cmidrule(lr){2-8}" ) ///
    collabels(none) replace posthead("\midrule") 
	
	
* Panel A2: to LaTeX
estout U_av9_Rc1 U_odds_3 U_av9_Rc3 U_av9_Rc4 U_av9_Rc5 U_av9_Rc6 U_av9_Rc7 using "tablea5.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(ratio_av_FU Oratio_odds_UF log_abil_diff) ///
	    refcat(log_abil_diff "\noalign{\smallskip}\textit{A.2: Underdog's performance in contest}", nolabel) ///
    varlabels(ratio_av_FU "Ability ratio" log_abil_diff "log difference" Oratio_odds_UF "odds ratio") ///
    collabels(none) mlabels(none)  append  
	
* Panel B1: to LaTeX
estout F_av9_h1_Rc1 F_h1_odds_3 F_av9_h1_Rc3 F_av9_h1_Rc4 F_av9_h1_Rc5 F_av9_h1_Rc6 F_av9_h1_Rc7 using "tablea5.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(ratio_av_FU Oratio_odds_UF log_abil_diff) ///
	    refcat(log_abil_diff "\noalign{\smallskip}\textit{B.1: Favorite's performance in first half of contest}", nolabel) ///
    varlabels(ratio_av_FU "Ability ratio" log_abil_diff "log difference" Oratio_odds_UF "odds ratio") ///
    collabels(none) mlabels(none)  append  



* Panel B2: to LaTeX
estout U_av9_h1_Rc1 U_h1_odds_3 U_av9_h1_Rc3 U_av9_h1_Rc4 U_av9_h1_Rc5 U_av9_h1_Rc6 U_av9_h1_Rc7 using "tablea5.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(ratio_av_FU Oratio_odds_UF log_abil_diff) ///
		refcat(log_abil_diff " \noalign{\smallskip}\textit{B.2: Underdog's performance in first half of contest}", nolabel) ///
    varlabels(ratio_av_FU "Ability ratio" log_abil_diff "log difference" Oratio_odds_UF "odds ratio") ///
			  stats(N, fmt(%9.0fc) labels("\midrule \noalign{\smallskip}N")) ///
			postfoot("\bottomrule \bottomrule" "\end{tabular}%" "}")  ///
			collabels(none) mlabels(none) append
			
********************************************************************************
			
			
***Table A.6						  											

*Panel A: Favorite
reg Fav_100_rel ratio_av_FU `var_f_3',vce(cluster Fav_id)
estimates store F_100_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Fav_140_rel ratio_av_FU `var_f_3',vce(cluster Fav_id)
estimates store F_140_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Fav_180_rel ratio_av_FU `var_f_3',vce(cluster Fav_id)
estimates store F_180_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace


*Panel B: Underdog
reg Und_100_rel ratio_av_FU `var_u_3',vce(cluster Und_id)
estimates store U_100_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Und_140_rel ratio_av_FU `var_u_3',vce(cluster Und_id)
estimates store U_140_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Und_180_rel ratio_av_FU `var_u_3',vce(cluster Und_id)
estimates store U_180_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace


*Panel C: Mean 
reg Mean_100_rel ratio_av_FU `var_c_3',vce(cluster Fav_id)
estimates store M_100_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Mean_140_rel ratio_av_FU `var_c_3',vce(cluster Fav_id)
estimates store M_140_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Mean_180_rel ratio_av_FU `var_c_3',vce(cluster Fav_id)
estimates store M_180_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace



* Panel A: Favorite to LaTeX
estout F_100_3 F_140_3 F_180_3 using "tablea6.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(ratio_av_FU) ///
    refcat(ratio_av_FU "\noalign{\smallskip}\textit{Panel A: Favorite's performance}", nolabel) ///
    varlabels(ratio_av_FU "Ability ratio") ///
			  mlabels("(1)" "(2)" "(3)" ) ///
prehead("\resizebox{\columnwidth}{!}{%" "\begin{tabular}{l r r r  } \toprule \toprule & \multicolumn{1}{c}{$>$ 100 per leg} & \multicolumn{1}{c}{$>$ 140 per leg} & $>$ 180 per leg\\"  "\cmidrule(lr){2-4}" ) ///
    collabels(none) replace posthead("\midrule") 
	
	
		* Panel B: Underdog to LaTeX
estout U_100_3 U_140_3 U_180_3 using "tablea6.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(ratio_av_FU) ///
    refcat(ratio_av_FU "\noalign{\smallskip}\textit{Panel B: Underdog's performance}", nolabel) ///
    varlabels(ratio_av_FU "Ability ratio") ///
    collabels(none) mlabels(none)  append  


* Panel C: Mean to LaTeX
estout M_100_3 M_140_3 M_180_3 using "tablea6.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(ratio_av_FU) ///
	refcat(ratio_av_FU " \noalign{\smallskip}\textit{Panel C: Combined (average) performance}", nolabel) ///
    varlabels(ratio_av_FU "Ability ratio") ///
			  stats(a1 b1 c1 d1 N, fmt(%9.0fc) labels("\midrule \noalign{\smallskip}Stage FE" "Tournament-by-Year-FE" "Individual FE" "All Covariates" "\midrule \noalign{\smallskip}N")) ///
			postfoot("\bottomrule \bottomrule" "\end{tabular}%" "}")  ///
			collabels(none) mlabels(none) append
			
			
			
			
********************************************************************************


***Table A.7	


reg Und_h1_av9 ratio_av_FU `var_u_3',vce(cluster Und_id)
estimates store U_h1_av9_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Und_h2_av9 ratio_av_FU `var_u_3',vce(cluster Und_id)
estimates store U_h2_av9_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace


reg Fav_h1_av9 ratio_av_FU `var_f_3',vce(cluster Fav_id)
estimates store F_h1_av9_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Fav_h2_av9 ratio_av_FU `var_f_3',vce(cluster Fav_id)
estimates store F_h2_av9_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace



* to LaTeX
estout F_h1_av9_3 F_h2_av9_3 U_h1_av9_3 U_h2_av9_3 using "tablea7.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(ratio_av_FU Fav_starts Fav_rankN_lagged Und_rankN_lagged Fav_years_playing Und_years_playing Fav_home Und_home) ///
    varlabels(ratio_av_FU "Ability ratio" Fav_starts "Favorite starts first leg" Fav_rankN_lagged "Favorite world ranking" Und_rankN_lagged "Underdog world ranking" Fav_years_playing "Favorite experience" Und_years_playing "Underdog experience" Fav_home "Favorite at home event" Und_home "Underdog at home event") ///
			  mlabels("(1)" "(2)" "(3)" "(4)") ///
prehead("\resizebox{\columnwidth}{!}{%" "\begin{tabular}{l r r r r } \toprule \toprule & \multicolumn{2}{c}{Favorite} & \multicolumn{2}{c}{Underdog} \\"  " & \multicolumn{2}{c}{performance in} & \multicolumn{2}{c}{performance in} \\"  " & \multicolumn{1}{c}{first half} & \multicolumn{1}{c}{second half} & \multicolumn{1}{c}{first half} & \multicolumn{1}{c}{second half} \\""\cmidrule(lr){2-5}") ///
			  stats(a1 b1 c1 d1 N, fmt(%9.0fc) labels("\midrule \noalign{\smallskip}Stage FE" "Tournament-by-Year-FE" "Individual FE" "All Covariates" "\midrule \noalign{\smallskip}N")) ///
			postfoot("\bottomrule \bottomrule" "\end{tabular}%" "}")  ///
    collabels(none) replace posthead("\midrule") 


********************************************************************************


***Table A.8						  							   

reg Fav_win ratio_av_FU Fav_starts Fav_av_lagged Fav_rankN_lagged Und_rankN_lagged Fav_years_playing Und_years_playing Fav_home Und_home,vce(cluster Fav_id)
estimates store F_win_4
estadd local 	a1 "" , replace
estadd local 	b1 "" , replace
estadd local 	c1 "" , replace
estadd local 	d1 "" , replace

reg Fav_win ratio_av_FU `var_f_2',vce(cluster Fav_id)
estimates store F_win_2
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Fav_win ratio_av_FU `var_f_3',vce(cluster Fav_id)
estimates store F_win_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg share_max_legs ratio_av_FU `var_f_2',vce(cluster Fav_id)
estimates store F_leg_2
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg share_max_legs ratio_av_FU `var_f_3',vce(cluster Fav_id)
estimates store F_leg_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace


*  to LaTeX
estout F_win_2 F_win_3 F_win_4 F_leg_2 F_leg_3 using "tablea8.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(ratio_av_FU Fav_starts Fav_rankN_lagged Und_rankN_lagged Fav_years_playing Und_years_playing Fav_home Und_home Fav_av_lagged) ///
    varlabels(ratio_av_FU "Ability ratio" Fav_starts "Favorite starts first leg" Fav_rankN_lagged "Favorite world ranking" Und_rankN_lagged "Underdog world ranking" Fav_years_playing "Favorite experience" Und_years_playing "Underdog experience" Fav_home "Favorite at home event" Und_home "Underdog at home event" Fav_av_lagged "Favorite ability") ///
			  mlabels("(1)" "(2)" "(3)" "(4)" "(5)") ///
prehead("\resizebox{\columnwidth}{!}{%" "\begin{tabular}{l r r r r r} \toprule \toprule & \multicolumn{3}{c}{Favorite win} & \multicolumn{2}{c}{Legs needed} \\" "\cmidrule(lr){2-6}") ///
			  stats(a1 b1 c1 d1 N, fmt(%9.0fc) labels("\midrule \noalign{\smallskip}Stage FE" "Tournament-by-Year-FE" "Individual FE" "All Covariates" "\midrule \noalign{\smallskip}N")) ///
			postfoot("\bottomrule \bottomrule" "\end{tabular}%" "}")  ///
    collabels(none) replace posthead("\midrule") 


	
	
	
********************************************************************************


***Table A.9		
					



reg Fav_win Und_starts ratio_av_FU `var_f_3', vce(cluster Fav_id)
estimates store Fw_fma_3x
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Fav_av9 Und_starts ratio_av_FU `var_f_3', vce(cluster Fav_id)
estimates store F_fma_3x
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Und_av9 Und_starts ratio_av_FU `var_u_3', vce(cluster Und_id)
estimates store U_fma_3x
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Total_av Und_starts ratio_av_FU `var_c_3', vce(cluster Fav_id)
estimates store T_fma_3x
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace



* to LaTeX
estout Fw_fma_3x F_fma_3x U_fma_3x T_fma_3x using "tablea9.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(Und_starts ratio_av_FU Fav_rankN_lagged Und_rankN_lagged  Fav_years_playing Und_years_playing Fav_home Und_home) ///
    varlabels(Und_starts "Underdog head start" ratio_av_FU "Ability ratio" Fav_rankN_lagged "Favorite rank" Und_rankN_lagged "Underdog rank" Fav_years_playing "Favorite experience" Und_years_playing "Underdog experience" Fav_home "Favorite home" Und_home "Underdog home") ///
			  mlabels("(1)" "(2)" "(3)" "(4)" "(5)") ///
prehead("\resizebox{\columnwidth}{!}{%" "\begin{tabular}{l r r r r } \toprule \toprule & \multicolumn{1}{c}{Favorite} & \multicolumn{3}{c}{Performance} \\"  " & \multicolumn{1}{c}{Win} & Favorite & Underdog & Average \\" "\cmidrule(lr){2-5}") ///
			  stats(a1 b1 c1 d1 N, fmt(%9.0fc) labels("\midrule \noalign{\smallskip}Stage FE" "Tournament-by-Year-FE" "Individual FE" "All Covariates" "\midrule \noalign{\smallskip}N")) ///
			postfoot("\bottomrule \bottomrule" "\end{tabular}%" "}")  ///
    collabels(none) replace posthead("\midrule") 
	
	
	
	
********************************************************************************

****Table A.10		




reg Fav_win Upd_av_twin `var_f_3',vce(cluster Fav_id)
estimates store F_win_upd_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Fav_av9 Upd_av_twin `var_f_3',vce(cluster Fav_id)
estimates store F_av9_upd_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Fav_win Upd_av_twin Fav_starts Fav_rankN_lagged Und_rankN_lagged Fav_years_playing Und_years_playing Fav_home Und_home,vce(cluster Fav_id)
estimates store F_win_upd_4


reg Und_av9 Upd_av_twin `var_u_3',vce(cluster Und_id)
estimates store U_av9_upd_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace

reg Total_av Upd_av_twin `var_f_3' i.Und_id,vce(cluster Fav_id)
estimates store T_av9_upd_3
estadd local 	a1 "x" , replace
estadd local 	b1 "x" , replace
estadd local 	c1 "x" , replace
estadd local 	d1 "x" , replace


* to LaTeX
estout F_win_upd_3 F_win_upd_4 F_av9_upd_3 U_av9_upd_3 T_av9_upd_3 using "tablea10.tex", style(tex) ///
    cells(b(star fmt(3)) se(fmt(3) par)) label starlevels(* .1 ** .05 *** .01) ///
	keep(Upd_av_twin Fav_rankN_lagged Und_rankN_lagged  Fav_years_playing Und_years_playing Fav_home Und_home) ///
    varlabels(Upd_av_twin "Expected ability" Fav_rankN_lagged "Favorite rank" Und_rankN_lagged "Underdog rank" Fav_years_playing "Favorite experience" Und_years_playing "Underdog experience" Fav_home "Favorite home" Und_home "Underdog home") ///
			  mlabels("(1)" "(2)" "(3)" "(4)" "(5)") ///
prehead("\resizebox{\columnwidth}{!}{%" "\begin{tabular}{l r r r r r} \toprule \toprule & \multicolumn{2}{c}{Favorite} & \multicolumn{3}{c}{Performance} \\"  " & \multicolumn{2}{c}{Win} & Favorite & Underdog & Average \\" "\cmidrule(lr){2-6}") ///
			  stats(a1 b1 c1 d1 N, fmt(%9.0fc) labels("\midrule \noalign{\smallskip}Stage FE" "Tournament-by-Year-FE" "Individual FE" "All Covariates" "\midrule \noalign{\smallskip}N")) ///
			postfoot("\bottomrule \bottomrule" "\end{tabular}%" "}")  ///
    collabels(none) replace posthead("\midrule") 

	
	

